package featuremodel.constraint;

import featuremodel.FeatureModelDef;
import featuremodel.method.MRequireMethodBind;
import featuremodel.method.MRequireMethodUnbind;
import skyblue.Constraint;
import skyblue.Strength;
import skyblue.Variable;

public class MandatoryConstraint extends Constraint{
	
	private Variable parent;
	private Variable child;


	public MandatoryConstraint(Variable child, Strength strength, Variable parent) {
		
		super(strength);
		this.constraintType = FeatureModelDef.MANDOTARY_CONSTRAINT;
		this.setParent(parent);
		this.setChild(child);
		getVariables().add(child);
		getVariables().add(parent);

		
		getMethods().add(new MRequireMethodBind(child,parent));
		getMethods().add(new MRequireMethodUnbind(child,parent));
	
	}

	public void setParent(Variable parent) {
		this.parent = parent;
	}

	public Variable getParent() {
		return parent;
	}

	public void setChild(Variable child) {
		this.child = child;
	}

	public Variable getChild() {
		return child;
	}

}
